<?php
/**
* 微信小程序控制器
*
* 微信小程序相关接口
* @author      alvin 叶文华
* @version     1.0 版本号
*/
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use MaterialService;

class MaterialController extends Controller
{
    public function SyncMaterial(Request $request)
    {
        $scm_conn = 'mysql_scm';
        $remote_conn = 'sqlsrv';

        MaterialService::syncMaterialCategory($scm_conn, $remote_conn);
        MaterialService::syncMaterial($scm_conn, $remote_conn);
        $data = [
            "code" => 0,
            "msg"  => "操作成功",
            "data" => null
        ];

        return response()->json($data, 200, ['X-Custom-Header' => 'Value']);
    }

}
